<%--
  Created by IntelliJ IDEA.
  User: WangTeng
  Date: 2018/9/26
  Time: 17:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" import="org.openkoala.security.shiro.*"%>
<html>
<head>
    <title>用户手册</title>
</head>
<body>
<div class="row" id="root-doc">
    <div class="col-sm-11">
        <iframe id="documentIframe" src="" frameborder="0" width="100%"></iframe>
    </div>
    <div class="col-sm-1">
        <a class="btn btn-default" id="downloadDocBtn">
            <i class="fa fa-download"></i>&nbsp;下载文档
        </a>
    </div>
</div>
<script>
    $(function(){
        var documents = {
	            超级管理员: '01%20DRG住院医疗服务系统超级管理员操作手册_V3.1.0.pdf',
	            医院管理员: '02%20DRG住院医疗服务系统医院管理员操作手册_V3.1.0.pdf',
	            病案: '03%20DRG住院医疗服务病案质控系统操作手册_V3.1.0.pdf',
	            医政: '04%20DRG医疗服务绩效评价与分析系统操作手册_V3.1.0.pdf',
	            医保: '05%20DRG住院医疗费用监控与管理系统操作手册_V3.1.0.pdf',
	            科室: '06%20DRG住院医疗服务系统科主任操作手册_V3.1.0.pdf',
	     DRG首页质控: '07%20DRG住院医疗服务首页质控系统操作手册_V3.1.0.pdf'
        };
        var docName = documents['<%=CurrentUser.getRoleName()%>'];
        if (docName){
            var docPath = 'download/document/' + docName;
            var docIframe = $('#documentIframe')[0];
            docIframe.height = $(window).height()-182;
            docIframe.src = docPath;
            downloadDocBtn.href = docPath;
            downloadDocBtn.download = docName.substr(5, docName.length-5);
            docIframe.onload = function(){
                console.log('load complete');
            }
            $(window).resize(function(){
                docIframe.height = $(window).height()-182;
            });
        } else {
            $('#root-doc').html('<div style="padding: 100px;font-size: 25px;color: #aaa;text-align: center;"><i class="fa fa-file-pdf-o fa-4x"></i><br>暂无该角色操作手册</div>');
        }

    });

</script>
</body>
</html>
